JPEGTRAN(1) JPEGTRAN(1) NAME jpegtran−losslesstranscodingofJPEGfiles SYNOPSIS jpegtran[options][filename] DESCRIPTION jpegtrantranslatesJPEGfilesfromonevariantofJPEGtoanother,forexamplefrombaseline JPEGtoprogressiveJPEG.Thetransformationislossless:noimagedegradationoccurs,which wouldnotbetrueifyouuseddjpegfollowedbycjpeg.However,youcannotaltertheimage quality,becausethatwouldnotbealosslessoperation.jpegtranreadsthenamedJPEG/JFIF file,orthestandardinputifnofileisnamed,andproducesaJPEG/JFIFfileonthestandard output. OPTIONS jpegtranacceptsasubsetoftheswitchesrecognizedbycjpeg.Ifyouspecifynoswitches,you getaplainbaselineJPEGoutputfile. Allswitchnamesmaybeabbreviated;forexample,−optimizemaybewritten−optor−o. Upperandlowercaseareequivalent.Britishspellingsarealsoaccepted(e.g.,−optimise), thoughforbrevitythesearenotmentionedbelow. Thebasicswitchesare: −optimize Performoptimizationofentropyencodingparameters.Withoutthis,defaultencoding parametersareused.−optimizeusuallymakestheJPEGfilealittlesmaller,butatthe priceofslowercompression.Notethat−progressiveimplies−optimize. −progressive CreateprogressiveJPEGfile(seebelow). The−progressiveswitchcreatesa"progressiveJPEG"file.InthistypeofJPEGfile,thedata isstoredinmultiplescansofincreasingquality.Ifthefileisbeingtransmittedoveraslowcommunicationslink,thedecodercanusethefirstscantodisplayalow-qualityimageveryquickly, andcanthenimprovethedisplaywitheachsubsequentscan.ThefinalimageisexactlyequivalenttoastandardJPEGfileofthesamequalitysetting,andthetotalfilesizeisaboutthesame ---oftenalittlesmaller.Caution:progressiveJPEGisnotyetwidelyimplemented,somany decoderswillbeunabletoviewaprogressiveJPEGfileatall. Switchesforadvancedusers: −restartN EmitaJPEGrestartmarkereveryNMCUrows,oreveryNMCUblocksif"B"is attachedtothenumber.−restart0(thedefault)meansnorestartmarkers. −maxmemoryN Setlimitforamountofmemorytouseinprocessinglargeimages.Valueisinthousands ofbytes,ormillionsofbytesif"M"isattachedtothenumber.Forexample,−max4m selects4000000bytes.Ifmorespaceisneeded,temporaryfileswillbeused. −outfilename Sendoutputimagetothenamedfile,nottostandardoutput. −verbose Enabledebugprintout.More−v’sgivemoreoutput.Also,versioninformationisprinted atstartup. −debug Sameas−verbose. The−restartoptioninsertsextramarkersthatallowaJPEGdecodertoresynchronizeaftera transmissionerror.Withoutrestartmarkers,anydamagetoacompressedfilewillusuallyruin 15June1995 1 JPEGTRAN(1) JPEGTRAN(1) theimagefromthepointoftheerrortotheendoftheimage;withrestartmarkers,thedamageis usuallyconfinedtotheportionoftheimageuptothenextrestartmarker.Ofcourse,therestart markersoccupyextraspace.Werecommend−restart1forimagesthatwillbetransmitted acrossunreliablenetworkssuchasUsenet. Switchesforwizards: −scansfile Usethescanscriptgiveninthespecifiedtextfile. The"wizard"switchesareintendedforexperimentationwithJPEG.Ifyoudon’tknowwhatyou aredoing,don’tusethem.Theseswitchesaredocumentedfurtherinthefilewizard.doc. EXAMPLES ThisexampleconvertsabaselineJPEGfiletoprogressiveform: jpegtran−progressivefoo.jpg>fooprog.jpg ENVIRONMENT JPEGMEM Ifthisenvironmentvariableisset,itsvalueisthedefaultmemorylimit.Thevalueis specifiedasdescribedforthe−maxmemoryswitch.JPEGMEMoverridesthedefault valuespecifiedwhentheprogramwascompiled,anditselfisoverriddenbyanexplicit −maxmemory. SEEALSO cjpeg(1),djpeg(1),rdjpgcom(1),wrjpgcom(1) Wallace,GregoryK."TheJPEGStillPictureCompressionStandard",Communicationsofthe ACM,April1991(vol.34,no.4),pp.30-44. AUTHOR IndependentJPEGGroup BUGS Arithmeticcodingisnotsupportedforlegalreasons. Stillnotasfastaswe’dlike. 15June1995 2